package com.bgIntlgn.client.entity.buy;

import java.util.Date;

import yuhuibear.poat.annotations.action.AutoGenerateValue;
import yuhuibear.poat.annotations.relation.Field;
import yuhuibear.poat.annotations.relation.Table;
import yuhuibear.poat.object.bean.Bean;

/**
 * 采购单条目
 * 
 * @author yuhui
 * 
 */
/**
 * @author yuhui
 * 
 */
@Table(name = "buy_cargos", constrain = "")
public class BuyCargo implements Bean {

	@AutoGenerateValue(skipOnNull = true, sqlToGet = "select currval('order_cargos_id_seq')")
	@Field(name = "id", type = "bigserial", constrain = "primary key ")
	private Long id;

	/**
	 * 对应的采购订单
	 */
	@Field(name = "buy_id", type = "int8 ", constrain = " not null references buys(id) on update cascade on delete cascade")
	private Long buyId;

	/**
	 * 对应的采购计划
	 */
	@Field(name = "to_buy_id", type = "int8 ", constrain = " not null references to_buy_productions(id) on update cascade on delete cascade")
	private Long toBuyId;

	/**
	 * 指向一个具体版本
	 */
	@Field(name = "uid", type = "char(80)", constrain = " not null references element_subversions(uid) on update cascade ")
	private String uid;

	/**
	 * 产品的厂外别名
	 */
	@Field(name = "name_id", type = "int8", constrain = " not null references alias(id) on update cascade ")
	private Long nameId;

	/**
	 * 数量
	 */
	@Field(name = "quantity", type = "int", constrain = "not null default 0")
	private Integer quantity;

	/**
	 * 单价
	 */
	@Field(name = "price", type = "float ", constrain = " not null default 0.0")
	private Double price;

	/**
	 * 交货期
	 */
	@Field(name = "deliver_date", type = "date", constrain = "")
	private Date deliverDate;

	/**
	 *采购订单状态: {草稿， 正式订单， 采购中， 已入库}, [DictionaryType : 采购货物状态]
	 */
	@Field(name = "states", type = "int8", constrain = "not null references dictionarys(id)  on update cascade ")
	private Long states;

	/**
	 * 备注
	 */
	@Field(name = "comment", type = "varchar(1000)", constrain = "")
	private String comment;

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getBuyId() {
		return this.buyId;
	}

	public void setBuyId(Long buyId) {
		this.buyId = buyId;
	}

	public String getUid() {
		return this.uid.trim();
	}

	public void setUid(String uid) {
		this.uid = uid.trim();
	}

	public Long getNameId() {
		return this.nameId;
	}

	public void setNameId(Long nameId) {
		this.nameId = nameId;
	}

	public Integer getQuantity() {
		return this.quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Date getDeliverDate() {
		return this.deliverDate;
	}

	public void setDeliverDate(Date deliverDate) {
		this.deliverDate = deliverDate;
	}

	public Long getStates() {
		return this.states;
	}

	public void setStates(Long states) {
		this.states = states;
	}

	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Long getToBuyId() {
		return this.toBuyId;
	}

	public void setToBuyId(Long toBuyId) {
		this.toBuyId = toBuyId;
	}

}
